<!--
 * @Author: ljc
 * @Date: 2024-08-06 14:03:45
 * @LastEditors: g05047
 * @LastEditTime: 2024-11-25 16:36:05
 * @Description: 区划和单位自定义CSS样式
-->
<template>
  <el-form-item v-if="treeType==='ad'"
    :label="i18nt('designer.setting.adCustomClass')">
    <el-select v-model="optionModel.adConfig.adCustomClass"
      multiple
      filterable
      allow-create
      default-first-option>
      <el-option v-for="(item, idx) in cssClassList"
        :key="idx"
        :label="item"
        :value="item"></el-option>
    </el-select>
  </el-form-item>
  <el-form-item v-else
    :label="i18nt('designer.setting.agCustomClass')">
    <el-select v-model="optionModel.agConfig.agCustomClass"
      multiple
      filterable
      allow-create
      default-first-option>
      <el-option v-for="(item, idx) in cssClassList"
        :key="idx"
        :label="item"
        :value="item"></el-option>
    </el-select>
  </el-form-item>
</template>
<script>
import i18n from "@/utils/i18n";
import { deepClone } from "@/utils/util";
export default {
  name: "treeCustomClass-editor",
  componentName: 'PropertyEditor',
  mixins: [i18n],
  props: {
    designer: Object,
    selectedWidget: Object,
    optionModel: Object,
    treeType: String,
  },
  data() {
    return {
      cssClassList: [],
    }
  },
  created() {
    this.cssClassList = deepClone(this.designer.getCssClassList())
    //监听表单css代码改动事件并重新加载！
    this.designer.handleEvent('form-css-updated', (cssClassList) => {
      this.cssClassList = cssClassList
    })
  }
}
</script>
<style scoped>
</style>
